package com.example.mytayunapi.Mapper;

import com.example.mytayunapi.Entity.adminInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface adminMapper {

        //111
        @Insert("insert into admin(name,School_degree,password,role) values (#{name},#{School_degree},#{password},#{role})")
         Integer insertadminInfo(adminInfo adminIfo);

        @Select("SELECT * FROM admin WHERE School_degree = #{School_degree} AND password = #{password}")
        adminInfo findBySchool_degreeAndPassword(@Param("School_degree") String School_degree, @Param("password") String password);

        @Select("SELECT * FROM admin where School_degree like '%${School_degree}%';")
        List<adminInfo> getAlladminInfo(String School_degree);

        @Delete("delete from admin where School_degree=#{School_degree}")
        Integer deleteBySchool_degree(String School_degree);

        @Update("update admin set name=#{name},School_degree= #{school_degree},password=#{password},role=#{role} where School_degree=#{school_degree}")
        Integer updateadminInfo(adminInfo adminIfo);

}
